  <html>
 <head>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo MAIN_URL;?>js/coursesyllabusdetails.js"></script>
<script src="<?php echo MAIN_URL;?>js/easypaginate.min.js"></script>
<script type="text/javascript">
	
jQuery(function($){
	
	$('ul#items').easyPaginate({
		step:3
	});
	
});    
    
    </script>
     <script type="text/Javascript">


    $(document).ready(function(){ 
	  $("#r_button").click(function() {	
				   $(".error").hide();
				});
            $("#s_button").click(function() {
                $(".error").hide();
                var question=$("#question").val();
                var opt1=$("#opt1").val();
				var opt2=$("#opt2").val();
				var opt3=$("#opt3").val();
				var opt4=$("#opt4").val();
				var opt5=$("#opt5").val();
				var answer=$("#answer").val();
				var course=$("#course_combo").val();
			  
		       var chapter=$("#chapternames").val();
			   var option_multi=$("#option_multi").val();


				  
				 	  
	     if(question=="" || answer=="" || opt1==""|| opt2==""|| opt3==""|| opt4==""|| opt5=="")
	        {
		 
		   $("#blankError").show();
		   return false;
	       }
		  if(course=='-1')
	        {
	
		  $("#typeError").show();
		  return false;
	      }

		  if(chapter=='-1')
	        {
	
		  $("#chapterError").show();
		  return false;
	      }

		  if(option_multi=='-1')
	        {
	
		  $("#option_multierror").show();
		  return false;
	      }

           });


		   $("#course_combo").change(function() {	
			   
			     var courseid=$("#course_combo").val();
				  
				 loadchapters(courseid,'chapter_names');
          		 
				  });
	 
 });
</script>
 </head>

<body>
<form name="form3" method="post" action="<?php echo MAIN_URL;?>index.php/loginsuccess/insertmultiplequestion">
<p>Select Course :
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select align= "right" class="input" name="course_combo" id="course_combo">
 
<option value="-1" selected> 
<?php
 
if($course_details!=""){
 
echo "--Select Course--";
foreach ($course_details->result() as $row)
            {
	 print("<option value=\"{$row->id}\">{$row->courseName}</option>");
echo"<br>";
      }}
?>
	  </option>
	  </select>  </p>
	 
  <div id="chapter_names" style="height: 30px; width: 400px;">
            
           </div>

           <div id="multiplechoice">
          <p>Select Type :
		  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		  <select align= "right" class="input" name="option_multi" id="option_multi">
              <option value="-1" selected>--Select Option--</option>
			  <option value="0" > Single Choice</option>
			  <option value="1" > Muliple Choice</option>
		   </select></p>
           </div>
  
   
 
   <label>Question</label>
          <input type="text" name="question" id="question" >
           <label>Opt1</label>
		    
          <input type="text" name="opt1" id="opt1" >
		  <label>Opt2</label>
		    
          <input type="text" name="opt2" id="opt2" >
		  <label>Opt3</label>
		    
          <input type="text" name="opt3" id="opt3" >
		  <label>Opt4</label>
		    
          <input type="text" name="opt4" id="opt4" >
		  		  <label>Opt5</label>
		    
          <input type="text" name="opt5" id="opt5" >
		  <label>Answer(Opt No)</label>
		    
          <input type="text" name="answer" id="answer" >
  
             <input value="Clear" type="reset" id="r_button">
		  <input value="Submit" type="submit" id="s_button">
   <div id="messages" height="200px" width="200px">
  <div class="error" id="result" style="display:none">
   
  </div>
  <div class="error" id="typeError" style="display:none">
  <label style='float: left;  width: 171px; font-size: 13px;'>
  
  Please Select type</label></div>

    <div class="error" id="chapterError" style="display:none">
  <label style='float: left;  width: 171px; font-size: 13px;'>
  
  Please Select Chapter</label></div>
  
  <div class="error" style="display:none;" id="blankError">
  <label style='float: left; width: 221px; font-size: 13px;'>
  Enter Question answer and options</label></div>


  <div class="error" style="display:none;" id="option_multierror">
  <label style='float: left; width: 240px; font-size: 13px;'>
  Select Question is Multiple answer or not</label></div>


</div>
 
              <?php
               if($this->session->flashdata('question_response'))
                  {
      echo "<label class='error' style='float: left; margin-top: 12px;width: 171px; font-size: 16px; color: #04739D;'>
       Question Added..</label>";
	              unset($_SESSION['question_response']);
	  
                   }?>
   
  
 
</form>
</body>
</html>
                   